Hardhat の Tutorial をやっていく
https://hardhat.org/tutorial
https://gyazo.com/b5aa051d5e5ed0fb5b39eda44118156d
1. Overview
読んでおわり
2. Setting up the environment
VS Code 用の便利なやつがあるとのこと
https://marketplace.visualstudio.com/items?itemName=NomicFoundation.hardhat-solidity
https://hardhat.org/hardhat-vscode/docs/overview
インストールした
Node.js はセットアップ済みなのでそれを使うだけ
3. Creating a new Hardhat project
Hardhat の設定ファイルをつくっておすすめプラグインを導入しておわり
4. Writing and compiling smart contracts
シンプルさを重視するため、ここでつくるトークンはあえて ERC-20 準拠にはしないとのこと
本筋とは関係ないけど、サンプルコードを写経していると GitHub Copilot がばんばん正解を提示してくれてすごい
https://github.com/june29/hardhat-tutorial/blob/main/contracts/Token.sol
5. Testing contracts
ethers.js を使う
https://docs.ethers.io/v5/
Mocha を使う
https://mochajs.org/
RSpec にインスパイアされた系かな
Chapter 3 でインストールした @nomicfoundation/hardhat-toolbox ってやつに ethers.js と Mocha が含まれているのね
https://github.com/june29/hardhat-tutorial/blob/main/test/Token.js
6. Debugging with Hardhat Network
Solidity で console.log を使えるようにするぞ、という話
JavaScript 文化圏だ
https://github.com/june29/hardhat-tutorial/tree/main/artifacts のディレクトリは gitignore した方がいいのかな
7. Deploying to a live network
リモートネットワークにデプロイするときは Alchemy の API を使うみたい
Goerli ネットワークの Faucet をいくつか試したけど、どれも不安定な感じがして悩ましい
8. Hardhat Boilerplate Project
https://github.com/NomicFoundation/hardhat-boilerplate
9. Final thoughts
読んでおわり
https://gyazo.com/99b48435db8ba88401b8fb6f342be5ae